package com.wyf.config;

import com.wyf.annotation.MyCompScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@MyCompScan("com.wyf")
@PropertySource(value = {"classpath:jdbc.properties", "classpath:user.properties"})
public class IocConfig4 {
    @Value("${jdbc.driver}")
    private String driver;
    @Value("${jdbc.url}")
    private String url;
    @Value("${jdbc.username}")
    private String userName;
    @Value("${jdbc.password}")
    private String password;

    // 控制台打印属性信息
    public void showConfigInfo() {
        System.out.println("driver:" + driver + "\nurl:" + url);
        System.out.println("userName:" + userName + "\npassword:" + password);
    }
}
